﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Smart
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            AppRegistry.Instance.IsolatedStorage(string.Empty);

            Application.Current.Host.Content.IsFullScreen = (editFullScreen.IsChecked == true);

            var service = new Service.ServiceCommand();
            var request = new Smart.Service.XmlServiceRequest();
            request["filter"] = string.Format(editName.Tag.ToString(), editName.Text)
                + " AND "
                + string.Format(editPassword.Tag.ToString(), editPassword.Password);

            service.Service = "login_action";

            service.Request = request;
            service.ActionCallback = (result) =>
            {
                MessageBox.Show(result.Message.ToString());
            };
            service.Execute(null);
        }
    }
}
